package com.easyadmin.entity.enums;

public enum OperModuleEnum {
    NO_OBJECT(-1, "未知操作"),
    OBJECT_LOGIN(0, "登录"),
    OBJECT_MENU(1, "菜单设置"),
    OBJECT_DIC(2, "字典管理"),
    OBJECT_ROLE(3, "角色管理"),
    OBJECT_ACCOUNT(4, "账号管理"),
    OBJECT_TASK(5, "定时任务管理");

    private int type;
    private String description;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    OperModuleEnum(int type, String description) {
        this.type = type;
        this.description = description;
    }

    public static OperModuleEnum getOperObjectByType(Integer type) {
        for (OperModuleEnum at : OperModuleEnum.values()) {
            if (at.type == type) {
                return at;
            }
        }
        return null;
    }
}
